import wx
from tabs import Tabs
from model import Model

class Application(wx.Frame):
    
    def __init__(self):
        """Constructor"""
        wx.Frame.__init__(self, None, wx.ID_ANY,
                          "Application",
                          size=(800,700)
                          )
        panel = wx.Panel(self)

        menubar = wx.MenuBar()

        fileMenu = wx.Menu()
        helpMenu = wx.Menu()

        importItem = wx.MenuItem(fileMenu, 102, '&Import\tCtrl+I', 'Import JSON file')
        fileMenu.AppendItem(importItem)
        wx.EVT_MENU(self, 102, self.OnImport)

        quitItem = wx.MenuItem(fileMenu, 101, '&Quit\tCtrl+Q', 'Quit the Application')
        fileMenu.AppendItem(quitItem)
        wx.EVT_MENU(self, 101, self.OnQuit )

        menubar.Append(fileMenu, '&File')
        menubar.Append(helpMenu, '&Help')

        self.model = Model()

        notebook = Tabs(panel, self.model)
        sizer = wx.BoxSizer(wx.VERTICAL)
        #sizer.Add(menubar, 1, wx.ALL, 5)
        sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)
        panel.SetSizer(sizer)
        self.SetMenuBar(menubar)
        self.Layout()

        self.Show()

    def OnQuit(self, event):
        self.Close()

    def OnImport(self, event):
        #Open up file dialog and get path.
        return


if __name__ == "__main__":
    app = wx.PySimpleApp()
    frame = Application()
    app.MainLoop()
